<html>
<head>
<title>::.::.::  APPMA  ||  Search  ::.::.::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ImageReady Styles (index.psd) -->

<link href="css/styleinner.css" rel="stylesheet" type="text/css">

<link href="css/css_tab/samples.css" rel="stylesheet" type="text/css">
<link href="css/css_tab/SprySlidingPanels.css" rel="stylesheet" type="text/css">
<link href="css/css_tab/tab_style.css" rel="stylesheet" type="text/css">
<!-- End ImageReady Styles -->
<script src="java/SprySlidingPanels.js" type="text/javascript"></script>
  <link type="text/css" rel="stylesheet" href="templates/standard/search.css">
  <!-- suggest script -->
	<style type="text/css">@import url("include/js_suggest/SuggestFramework.css");</style>
	<script type="text/javascript" src="include/js_suggest/SuggestFramework.js"></script>
	<script type="text/javascript">window.onload = initializeSuggestFramework;</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->


</script>

<style type="text/css">
<!--

#usefullinks {
	position:absolute;
	width:381px;
	height:94px;
	z-index:1;
	left: 38px;
	top: 30px;
}
-->
</style>
</head>
<body style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; background-color:#858585;">
<!-- ImageReady Slices (index.psd) -->
<center><div id="Table_01">
	<div id="index-01">
	
	  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="621" height="150">
        <param name="movie" value="flash/title.swf">
        <param name="quality" value="high">
        <embed src="flash/title.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="621" height="150"></embed>
      </object>
    </div>
	<div id="index-02">
		
	
			  <div id="contactlink" onClick="MM_goToURL('parent','contact.php');return document.MM_returnValue"></div>
	  <div id="feedback" onClick="MM_goToURL('parent','feedback.php');return document.MM_returnValue"></div>
	  <div id="sitemap" onClick="MM_goToURL('parent','sitemap.php');return document.MM_returnValue"></div>

<?php if(isset($_SESSION['SESS_MEMBER_ID'])) {
	echo '<div id="logout"><a href="logout.php">Logout</a></div>';
	}	  
	 ?> 
	
	

	  <div id="search">
	  <form action="search.php" method="get">
	  <td valign="middle" height="30px">
	  <input type="text" name="query" height="20px" size="30" action="include/js_suggest/suggest.php"></td>
	  <input type="text" name="search" value="1" style="display:none;">
	  <td valign="middle" height="30px">
	  <input type="submit" class="searchbtn" value=""></td>
	  </form>
	  </div>
	
	
	
	</div>
	<div id="index-03">
		
		
				<?php
				$File = "nav.html";
				$fh = fopen($File, 'r');
				$List = fread($fh, filesize($File));
				fclose($fh);
				echo $List;
			?> 
		
		
	</div>
	<div id="index-04">
    <?php
				$File = "menuleft.html";
				$fh = fopen($File, 'r');
				$List = fread($fh, filesize($File));
				fclose($fh);
				echo $List;
			?> 
		
    
    
   
    </div>
	<div id="index-09">
	  <div id="platinum">

<?php
$con = mysql_connect("localhost","appma" ,"database");
mysql_select_db("162_appma", $con);
$sql="SELECT link FROM sponsor WHERE sponsor='platinum'";
if (!$sql)
	  {
	  die('Could Not Complete Please Try Again Later: ' );
	  }
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
?>
<a href="<?php echo $row['link']; ?>" target="_blank">
<img src="uploader/sponsor/platinum.jpg"></a>

	  </div>
	</div>
	<div id="index-13">
	  <div id="gold">
	  
	<?php
$con = mysql_connect("localhost","appma" ,"database");
mysql_select_db("162_appma", $con);
$sql="SELECT link FROM sponsor WHERE sponsor='gold'";
if (!$sql)
	  {
	  die('Could Not Complete Please Try Again Later: ' );
	  }
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
?>
<a href="<?php echo $row['link']; ?>" target="_blank">
<img src="uploader/sponsor/gold.jpg"></a>
	  
	  </div>
    
    </div>
	<div id="index-16">
	  <div id="contact">
	    <p>HEAD OFFICE: Room #104,Azeem Chamber,<br>
		Hasan Ali Effendi Road, Karachi-74200.<br>
	      Phone: 021-32621041,<br>
	      Fax: 021-32210385,<br>
	      Email: paperassociation@homail.com<br>
        URL: www.appma.com.pk</p>
      </div>

	</div>
    <div id="mid">
    <div id="text">


  <table cellpadding="0" cellspacing="0">
    <tr> 
      <td>
		</td>
				
          
      <div> 
        <div align="left"><font size="+2" face="Lucida Calligraphy">Search Results</font></div>
      </div>

      <td><div> 

<?php
/*******************************************
* Sphider Version 1.3.x
* This program is licensed under the GNU GPL.
* By Ando Saabas          ando(a t)cs.ioc.ee
********************************************/
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); 
error_reporting(E_ALL); 
$include_dir = "./include"; 
include ("$include_dir/commonfuncs.php");
//extract(getHttpVars());

if (isset($_POST['search']))
	$query = $_POST['search'];

if (isset($_GET['query']))
	$query = $_GET['query'];
if (isset($_GET['search']))
	$search = $_GET['search'];
if (isset($_GET['domain'])) 
	$domain = $_GET['domain'];
if (isset($_GET['type'])) 
	$type = $_GET['type'];
if (isset($_GET['catid'])) 
	$catid = $_GET['catid'];
if (isset($_GET['category'])) 
	$category = $_GET['category'];
if (isset($_GET['results'])) 
	$results = $_GET['results'];
if (isset($_GET['start'])) 
	$start = $_GET['start'];
if (isset($_GET['adv'])) 
	$adv = $_GET['adv'];
	
	
$include_dir = "./include"; 
$template_dir = "./templates"; 
$settings_dir = "./settings"; 
$language_dir = "./languages";


require_once("$settings_dir/database.php");
require_once("$language_dir/en-language.php");
require_once("$include_dir/searchfuncs.php");
require_once("$include_dir/categoryfuncs.php");


include "$settings_dir/conf.php";

include "$template_dir/$template/header.html";
include "$language_dir/$language-language.php";


if ($type != "or" && $type != "and" && $type != "phrase") { 
	$type = "and";
}

if (preg_match("/[^a-z0-9-.]+/", $domain)) {
	$domain="";
}


if ($results != "") {
	$results_per_page = $results;
}

if (get_magic_quotes_gpc()==1) {
	$query = stripslashes($query);
} 

if (!is_numeric($catid)) {
	$catid = "";
}

if (!is_numeric($category)) {
	$category = "";
} 



if ($catid && is_numeric($catid)) {

	$tpl_['category'] = sql_fetch_all('SELECT category FROM '.$mysql_table_prefix.'categories WHERE category_id='.(int)$_REQUEST['catid']);
}
	
$count_level0 = sql_fetch_all('SELECT count(*) FROM '.$mysql_table_prefix.'categories WHERE parent_num=0');
$has_categories = 0;

if ($count_level0) {
	$has_categories = $count_level0[0][0];
}



require_once("$template_dir/$template/search_form.html");


function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
    }






function saveToLog ($query, $elapsed, $results) {
        global $mysql_table_prefix;
    if ($results =="") {
        $results = 0;
    }
    $query =  "insert into ".$mysql_table_prefix."query_log (query, time, elapsed, results) values ('$query', now(), '$elapsed', '$results')";
	mysql_query($query);
                    
	echo mysql_error();
                        
}

switch ($search) {
	case 1:

		if (!isset($results)) {
			$results = "";
		}
		$search_results = get_search_results($query, $start, $category, $type, $results, $domain);
		require("$template_dir/$template/search_results.html");
	break;
	default:
		if ($show_categories) {
			if ($_REQUEST['catid']  && is_numeric($catid)) {
				$cat_info = get_category_info($catid);
			} else {
				$cat_info = get_categories_view();
			}
			require("$template_dir/$template/categories.html");
		}
	break;
	}

include "$template_dir/$template/footer.html";
?>
          
</td>
		  				  <td> 


    </tr>
	
    <tr>
      <td width="50">

	  </td>
    </tr>
  </table>


 </div>
	<div id="bottom">
		<img src="images/index_18.jpg" width="1003" height="42" alt="">	</div>
</div>
</div>
</center>
<!-- End ImageReady Slices -->
</body>
</html>